package com.ssm.order.exception;

import com.alibaba.cloud.sentinel.rest.SentinelClientHttpResponse;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.alibaba.fastjson.JSON;
import com.ssm.dto.CommonResult;
import com.ssm.model.stock.StockModel;
import org.springframework.http.HttpRequest;
import org.springframework.http.client.ClientHttpRequestExecution;
import org.springframework.web.bind.annotation.PathVariable;

public class SentinelResourceExceptionHandler {

    //限流熔断业务逻辑
    public static CommonResult<StockModel> blockHandler(@PathVariable Integer id) {
        return CommonResult.error(null, -100, "系统错误 (限流熔断业务逻辑)");
    }

    //异常降级业务逻辑
    public static CommonResult<StockModel> fallback(@PathVariable Integer id) {
        return CommonResult.error(null, -100, "系统错误 (异常降级业务逻辑)");
    }
}
